﻿using System.ComponentModel.DataAnnotations;
using Stickers.Common;
using Stickers.Common.DataAccess;

namespace Stickers.WebApi.Models;

[Table("Stickers")]
public class Sticker(string title, string content): IEntity
{
    public Sticker()
        : this(string.Empty, string.Empty)
    {
        
    }
    
    public int Id { get; set; }

    [Required]
    [StringLength(50)]
    public string Title { get; set; } = title;

    public string Content { get; set; } = content;
    
    [StringLength(128)]
    public string UserId { get; set; } = string.Empty;

    [Field("DateCreated")]
    public DateTime CreatedOn { get; set; } = DateTime.UtcNow;
    
    [Field("DateModified")]
    public DateTime? ModifiedOn { get; set; }
}